package com.groupbuying.payproducer.dto;

import com.groupbuying.payproducer.constants.PayInfoEnumConstants;
import com.groupbuying.payproducer.domain.PayInfoDO;
import com.groupbuying.payproducer.utils.DateUtils;

/**
 * @Author Vincentxin
 * @Date 2019-05-21
 */
public class PaySuccessResultDTO {

    /**
     * 商户名称
     */
    private String shopName;
    /**
     * 订单号
     */
    private String orderId;
    /**
     * 消费金额
     */
    private String cost;
    /**
     * 支付方式
     */
    private String payType;
    /**
     * 积分变动
     */
    private String integral;
    /**
     * 支付时间
     */
    private String payTime;

    /**
    * 实付积分
    * */
    private String payCurrency;


    public PaySuccessResultDTO(PayInfoDO payInfoDO) {
        this.payType = payInfoDO.getPayType();
        this.payTime = DateUtils.format(payInfoDO.getGmtModified(),DateUtils.YMDHMS);
        switch (payInfoDO.getPayType()){
            case PayInfoEnumConstants.ENUM_PAYTYPE_WX:{
                this.payType = "微信支付";
            }break;
            case PayInfoEnumConstants.ENUM_PAYTYPE_ALI:{
                this.payType = "支付宝支付";
            }break;
            case PayInfoEnumConstants.ENUM_PAYTYPE_CUR:{
                this.payType = "积分支付";
            }break;
            case PayInfoEnumConstants.ENUM_PAYTYPE_BAL:{
                this.payType = "余额支付";
            }break;
        }
    }

    public PaySuccessResultDTO() {
    }


    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getCost() {
        return cost;
    }

    public void setCost(String cost) {
        this.cost = cost;
    }

    public String getIntegral() {
        return integral;
    }

    public void setIntegral(String integral) {
        this.integral = integral;
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getPayCurrency() {
        return payCurrency;
    }

    public void setPayCurrency(String payCurrency) {
        this.payCurrency = payCurrency;
    }

    @Override
    public String toString() {
        return "PaySuccessResultDTO{" +
                "shopName='" + shopName + '\'' +
                ", orderId='" + orderId + '\'' +
                ", cost='" + cost + '\'' +
                ", payType='" + payType + '\'' +
                ", integral='" + integral + '\'' +
                ", payTime='" + payTime + '\'' +
                ", payCurrency='" + payCurrency + '\'' +
                '}';
    }
}
